#include int RECV_PIN = 11; int red = 5; int green = 6; int blue = 7; int redStat = 0; int greenStat = 0; int blueStat = 0; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); pinMode(red, OUTPUT); pinMode(green, OUTPUT); pinMode(blue, OUTPUT); } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value); //???????? if (results.value == 0xFF906F && redStat == 0) { digitalWrite(red, HIGH); redStat = 1; } else if (results.value == 0xFF906F && redStat == 1) { digitalWrite(red, LOW); redStat = 0; } //??????? if (results.value == 0xFF10EF && greenStat == 0) { digitalWrite(green, HIGH); greenStat = 1; } else if (results.value == 0xFF10EF && greenStat == 1) { digitalWrite(green, LOW); greenStat = 0; } //????? if (results.value == 0xFF50AF && blueStat == 0) { digitalWrite(blue, HIGH); blueStat = 1; } else if (results.value == 0xFF50AF && blueStat == 1) { digitalWrite(blue, LOW); blueStat = 0; } irrecv.resume(); } }